﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Weixin.Entity.Weixin;
using Weixin.Utils;

namespace WebTest
{
    public partial class JsonTest : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //string rtn = WebRequestHelper.GetData("http://www.autohome.com.cn/ashx/AjaxIndexCarFind.ashx", "type=1&t=" + Guid.NewGuid());
            
            ////Response.Write(rtn);
            //ReturnMain rm = JsonHelper.DeserializeJson<ReturnMain>(rtn);
            //Response.Write(rm.result.branditems[0].name);


            string rtn = WebRequestHelper.PostData("http://1111.autohome.com.cn/Post/GetCouponStockList", "frontMsg=[{\"channelId\":2,\"productId\":99825115,\"cityId\":110100,\"seriesId\":3170,\"specId\":0,\"colorId\":0,\"interior\":0},{\"channelId\":2,\"productId\":99825122,\"cityId\":110100,\"seriesId\":3170,\"specId\":0,\"colorId\":0,\"interior\":0},{\"channelId\":2,\"productId\":99823074,\"cityId\":110100,\"seriesId\":3170,\"specId\":0,\"colorId\":0,\"interior\":0},{\"channelId\":2,\"productId\":99820459,\"cityId\":110100,\"seriesId\":3170,\"specId\":0,\"colorId\":0,\"interior\":0}]");
            Response.Write(rtn);
        }
    }

    public class ReturnMain
    {
        public string returncode { get; set; }
        public string message { get; set; }
        public Returnbranditems result { get; set; }
    }

    public class Returnbranditems
    {
        public List<ReturnBrand> branditems { get; set; }
    }

    public class ReturnBrand
    {
        public string id { get; set; }
        public string name { get; set; }
        public string bfirstletter { get; set; }
    }
}